<?$attributes = array('class' => 'email', 'id' => 'checknew');
echo form_open('product_category/dels', $attributes);?>    

<input type="hidden" name="page" value="<?php echo (int)$this->uri->segment('3')?>">
        <table class="admindata">
            <thead>
                <tr>
                    <th colspan="6">
                        <input type="submit" onclick="return verify_del();" name="btn_submit" class="submit" value="Xóa">
                        Hiện có <?php echo $num?> danh mục sản phẩm <?php echo $pagination?>
                        <div class="fr">
                           <!-- <a href="<?php echo site_url('product_category/add')?>">Thêm mới</a> -->
                        </div>
                    </th>
                </tr>
                <tr>
                    <th class="checkbox"><input type="checkbox" name="sa" id="sa" onclick="check_chose('sa', 'ar_id[]', 'checknew')" /></th>
                    <th>ID</th>
                    <th><?php echo lang('product_category_name');?></th>
                     <!--<th>Hình đại diện</th>-->
                    <th>Vị trí hiện thị</th>
                    <th class="publish" style="width: 90px;">Active</th>
                </tr>                
                
                
            </thead>
            <?
            $k=1;
            foreach($list as $rs):
				$listsub = $this->product_category->getSubCategory($rs->product_category_id);
			?>
            <tr class="row<?php echo $k?>">
                <td><input type="checkbox" name="ar_id[]" value="<?php echo $rs->product_category_id?>"></td>
                 <td><?php echo $rs->product_category_id?></td>
                <td>
                   <span style="font-weight:bold; color:#F00; font-size:14px;"><?php echo $rs->name?></span>
                </td>
                <!--<td>
                   <?php if($rs->image){ ?>
                   <img src="<?php echo base_url_site()."uploads/productcate/".$rs->image;?>" alt="" width="100" height="100" />
                   <?php } ?>
                </td>-->
                <td>
                    <?php echo $rs->nb_order?>
                </td>
                <td align="center">
                    <?php echo icon_edit('product_category/edit/'.$rs->product_category_id)?>
                    <span id="publish<?php echo $rs->product_category_id?>"><?php echo icon_active("'product_category'","'product_category_id'",$rs->product_category_id,$rs->bl_active)?></span>
                    <?php echo icon_del('product_category/del/'.$rs->product_category_id.'/'.(int)$this->uri->segment(4))?>
                </td>
            </tr>
          <!-- menu cấp 3-->
            <?php if(count($listsub) > 0){?>
			<?php foreach($listsub as $val):
                $listsub1 = $this->product_category->getSubCategory($val->product_category_id);
            ?>
            <tr class="row<?php echo $k?>">
                <td><input type="checkbox" name="ar_id[]" value="<?php echo $val->product_category_id?>"></td>
                <td><?php echo $val->product_category_id?></td>
                <td>
                   |_____<?php echo $val->name?>
                </td>
                <!--<td>
                   <?php if($val->image){ ?>
                   <img src="<?php echo base_url_site()."uploads/productcate/".$val->image;?>" alt="" width="100" height="100" />
                   <?php } ?>
                </td>-->
                <td>
                    <?php echo $val->nb_order?>
                </td>
                <td align="center">
                    <?php echo icon_edit('product_category/edit/'.$val->product_category_id)?>
                    <span id="publish<?php echo $val->product_category_id?>"><?php echo icon_active("'product_category'","'product_category_id'",$val->product_category_id,$val->bl_active)?></span>
                    <?php echo icon_del('product_category/del/'.$val->product_category_id.'/'.(int)$this->uri->segment(4))?>
                </td>
            </tr>
             <?php if(count($listsub1) > 0){?>
			<?php foreach($listsub1 as $sub_val):
               
            ?>
            <tr class="row<?php echo $k?>">
                <td><input type="checkbox" name="ar_id[]" value="<?php echo $sub_val->product_category_id?>"></td>
                <td><?php echo $sub_val->product_category_id?></td>
                <td>
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |_____<?php echo $sub_val->name?>
                </td>
                <td>
                    <?php echo $sub_val->nb_order?>
                </td>
                <td align="center">
                    <?php echo icon_edit('product_category/edit/'.$sub_val->product_category_id)?>
                    <span id="publish<?php echo $sub_val->product_category_id?>"><?php echo icon_active("'product_category'","'product_category_id'",$sub_val->product_category_id,$sub_val->bl_active)?></span>
                    <?php echo icon_del('product_category/del/'.$sub_val->product_category_id.'/'.(int)$this->uri->segment(4))?>
                </td>
            </tr>
            <?php endforeach?>
       		 <?php } ?>
             
            <?php endforeach?>
       		 <?php } ?>

            <?
            $k=1-$k;
            endforeach;?>
            <tfoot>
                <td colspan="6">
                    <input type="submit" class="submit" onclick="return verify_del();" name="btn_submit" value="Xóa">
                    Hiện có <?php echo $num?>  danh mục sản phẩm<?php echo $pagination?>
                </td>
            </tfoot>
        </table>  
<?php echo form_close()?>  
